﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Snake
{
    class Node
    {
        public int X { get; set; }
        public int Y { get; set; }
        public Direction direction;
        public ConsoleColor Color { get; private set; }
        public char NodeSymbol { get; private set; }

        public Node(int x, int y, ConsoleColor color, char nodeSymbol)
        {
            X = x;
            Y = y;
            Color = color;
            NodeSymbol = nodeSymbol;
        }

        public void MoveRight()
        {
            X++;
        }

        public void MoveLeft()
        {
            X--;
        }

        public void MoveDown()
        {
            Y++;
        }

        public void MoveUp()
        {
            Y--;
        }

        public virtual void Move(Func<int, int, Position> position)
        {
            if (direction == Direction.Left)
            {
                MoveLeft();
            }
            if (direction == Direction.Right)
            {
                MoveRight();
            }
            if (direction == Direction.Up)
            {
                MoveUp();
            }
            if (direction == Direction.Down)
            {
                MoveDown();
            }
        }
    }

    enum Direction
    {
        Left,
        Right,
        Up,
        Down
    }
}
